package com.i.me.login;

import android.annotation.SuppressLint;
import android.content.Context;
import android.widget.Toast;

import com.i.me.login.entity.User;
import com.library.base.http.result.ApiResult;
import com.library.base.mvp.BasePresenter;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;

public class LoginP extends BasePresenter<LoginContral.View> implements LoginContral.Presenter {
    private LoginM mModel = new LoginM();

    @SuppressLint("CheckResult")
    @Override
    public void login(String userName, String password) {
        mModel.login(userName,password)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(userApiResult -> {
            Toast.makeText((Context) mView,"111",Toast.LENGTH_SHORT).show();
        },throwable -> {
            Toast.makeText((Context) mView,"222",Toast.LENGTH_SHORT).show();
        });
    }

}
